const app = getApp()

module.export = (url, data, method = "get", header = {}) => {
  wx.showLoading({
    title: 'loading..............',
    mask: true
  })
  return new Promise((resolve, rejects) => {
    wx.request({
      url: app.globalData.url + url,
      data,
      header,
      method,
      dataType: 'json',
      success: resolve,
      fail: rejects,
      complete: wx.hideLoading

    })
  })
}